import type { MenuVo } from '@/api/menu/type'
import { request } from '@/utils/axios/axios'

enum API {
  MENU = 'menu',
}

// 添加菜单
export const addMenuRequest = (menuVo: MenuVo): Promise<string> => {
  return request.post<MenuVo, string>(API.MENU, menuVo)
}
// 查询全部菜单的请求
export const queryAllMenusRequest = (): Promise<MenuVo[]> => {
  return request.get<null, MenuVo[]>(API.MENU)
}
// 更新菜单
export const updateMenuRequest = (menuVo: MenuVo): Promise<string> => {
  return request.put<MenuVo, string>(API.MENU, menuVo)
}
// 删除菜单
export const deleteMenuRequest = (menuID: number) => {
  return request.delete(API.MENU + `/${menuID}`)
}
